From: Jan Beulich Date: Mon, 8 May 2017 15:48:32 +0000 (+0200) Subject: x86/mm: add temporary debugging code to get_page_from_gfn_p2m() X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2164 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=933f966bcdf4f4255b432071fc12c9ee2efb05ef;p=xen.git x86/mm: add temporary debugging code to get_page_from_gfn_p2m() See the code comment. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Acked-by: George Dunlap Release-acked-by: Julien Grall --- diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index ae70a920b5..dacf3e2f62 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -480,6 +480,22 @@ struct page_info *get_page_from_gfn_p2m( p2m_access_t _a; p2m_type_t _t; mfn_t mfn; +#ifndef NDEBUG + /* + * Temporary debugging code, added in the hope of finding the origin + * of calls to get_page(..., dom_cow) as observed during osstest + * migration failures (see + * lists.xenproject.org/archives/html/xen-devel/2017-04/msg03331.html). + */ + static unsigned long cnt, thr; + + if ( d->is_dying && ++cnt > thr ) + { + thr |= cnt; + printk("%pv: d%d dying (looking up %lx)\n", current, d->domain_id, gfn); + dump_execution_state(); + } +#endif /* Allow t or a to be NULL */ t = t ?: &_t;